<?php
final class Controller_Xheditor extends Controller_Security{
    protected function Acquiescent(){
        $up=new Uploader('filedata');
        $up->Size=204800*1000000;
        $up->Path=$GLOBALS['ApplicationConfig']['Path']['UploadXheditor'];
        $up->FileExtension=array('gif','jpg','png','bmp');
        $up->Execute();
        switch($up->ErrorCode){
            case Uploader::UPLOAD_ERR_OK:
                echo json_encode(array('err'=>0,'msg'=>$GLOBALS['ApplicationConfig']['Path']['URIXheditor'].'/'.$up->Filename));
            break;
            case Uploader::UPLOAD_ERR_NO_FILE:
                echo '请上传文件。';
            break;
            case Uploader::UPLOAD_ERR_EXTENSION:
                echo '图片格式不正确，必须是gif、jpg、png、bmp格式。';
            break;
            case Uploader::UPLOAD_ERR_CUSTOM_SIZE:
                echo '文件过大。';
            break;
            default:
                echo '文件上传失败。';
            break;
        }
    }
}
?>